package iqq;

import iqq.util.Strings;

/**
 * 
 * Bootstrap for App
 * 
 * @author steven0lisa
 * @create-time Jul 27, 2012 8:11:45 PM
 */
public class AppBootstrap implements Bootstrap {

	public void start() {
		// read configuration
		App.readConfiguration();
		// read app.mode
		String mode = App.configuration.getProperty("app.mode", "dev");
		if (Strings.isEmpty(mode)) {
			App.mode = App.Mode.DEV;
		} else if ("dev".equalsIgnoreCase(mode)) {
			App.mode = App.Mode.DEV;
		} else if ("prod".equalsIgnoreCase(mode)) {
			App.mode = App.Mode.PROD;
		} else {
			App.mode = App.Mode.DEV;
		}
		// init app info
		App.name = App.configuration.getProperty("app.name", "iQQ");
		App.version = App.configuration.getProperty("app.version",
				"unknown version");
		System.out.println(App.name + " " + App.version);
	}

	public void stop() {

	}
}
